<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>

<!DOCTYPE HTML>
<html>
<head>
    <meta charset="utf-8">
    <meta name="renderer" content="webkit|ie-comp|ie-stand">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" />
    <meta http-equiv="Cache-Control" content="no-siteapp" />

    <script type="text/javascript" src="${pageContext.request.contextPath}/static/lib/html5shiv.js"></script>
    <script type="text/javascript" src="${pageContext.request.contextPath}/static/lib/respond.min.js"></script>

    <link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/static/static/h-ui/css/H-ui.min.css" />
    <link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/static/static/h-ui.admin/css/H-ui.admin.css" />
    <link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/static/lib/Hui-iconfont/1.0.8/iconfont.css" />
    <link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/static/static/h-ui.admin/skin/default/skin.css" id="skin" />
    <link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/static/static/h-ui.admin/css/style.css" />

    <link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/static//lib/bootstrap/bootstrap.css">

    <script type="text/javascript" src="${pageContext.request.contextPath}/static/lib/DD_belatedPNG_0.0.8a-min.js" ></script>
    <script>DD_belatedPNG.fix('*');</script>

    <title>学生列表</title>
</head>
<body>
<nav class="breadcrumb"><i class="Hui-iconfont">&#xe67f;</i> 首页 <span class="c-gray en">&gt;</span> 用户中心 <span class="c-gray en">&gt;</span> 用户管理 <a class="btn btn-success radius r" style="line-height:1.6em;margin-top:3px" href="javascript:location.replace(location.href);" title="刷新" ><i class="Hui-iconfont">&#xe68f;</i></a></nav>
<div class="page-container">
    <div class="text-c">
       <input type="text" class="input-text" style="width:250px" placeholder="输入会员名称" id="in" name="">
        <button type="button" class="btn btn-success radius" id="searchUser" name=""><i class="Hui-iconfont">&#xe665;</i> 搜用户</button>
    </div>
    <div class="cl pd-5 bg-1 bk-gray mt-20"><span class="r">共有数据：<strong>${num}</strong> 条</span> </div>
    <div class="mt-20">
        <table class="table table-border table-bordered table-hover table-bg table-sort">
            <thead>
            <tr class="text-c">
                <th width="25"><input type="checkbox" name="" value=""></th>
                <th width="80">学校</th>
                <th width="80">学号</th>
                <th width="100">班级</th>
                <th width="100">姓名</th>
                <th width="40">职业</th>
                <th width="90">年龄</th>
                <th width="150">性别</th>
                <th width="">民族</th>
                <th width="130">地址</th>
                <th width="70">电话</th>
                <th width="70">密码</th>
                <th width="100">操作</th>
            </tr>
            </thead>
            <tbody>
            <%--遍历返回回来的数据  此时就要用到JSTL标签--%>
          <c:forEach var="user" items="${tags}">
              <%-- 循环体--%>
              <tr class="text-c">
                  <td width="25"><input type="checkbox" name="" value=""></td>
                  <th width="100">${user.school}</th>
                  <th width="100">${user.studnum}</th>
                  <th width="100">${user.grade}</th>
                  <td><u style="cursor:pointer" class="text-primary" onclick="member_show('${user.username}','uc?op=UpdateStudentUI&userId=${user.userId}','10001','360','400')">${user.username}</u></td>
                  <th width="100">${user.occupation}</th>
                  <th width="100">${user.age}</th>
                  <th width="100">${user.sex}</th>
                  <th width="100">${user.nation}</th>
                  <th width="100">${user.address}</th>
                  <th width="100">${user.phone}</th>
                  <th width="100">${user.password}</th>
                  <td class="td-manage"></a>  <a style="text-decoration:none" class="ml-5" onClick="change_password('修改密码','uc?op=UpdateUserPasswordUI&userId=${user.userId}','10001','600','270')" href="javascript:;" title="修改密码"><i class="Hui-iconfont">&#xe63f;</i></a></td>
              </tr>
          </c:forEach>
            </tbody>
        </table>

    </div>
</div>

<script type="text/javascript" src="${pageContext.request.contextPath}/static/lib/jquery/1.9.1/jquery.min.js"></script>
<script type="text/javascript" src="${pageContext.request.contextPath}/static/lib/layer/2.4/layer.js"></script>
<script type="text/javascript" src="${pageContext.request.contextPath}/static/static/h-ui/js/H-ui.min.js"></script>
<script type="text/javascript" src="${pageContext.request.contextPath}/static/static/h-ui.admin/js/H-ui.admin.js"></script>

<script type="text/javascript" src="${pageContext.request.contextPath}/static/lib/My97DatePicker/4.8/WdatePicker.js"></script>
<script type="text/javascript" src="${pageContext.request.contextPath}/static/lib/datatables/1.10.0/jquery.dataTables.min.js"></script>
<script type="text/javascript" src="${pageContext.request.contextPath}/static/lib/laypage/1.2/laypage.js"></script>
<script type="text/javascript">
    $(function(){
        $("#searchUser").click(function () {
            var key = $("#in").val();
            window.location.href="uc?op=queryByKey&key="+key;
        })

    });
    /*用户-添加*/
    function member_add(title,url,w,h){
        layer_show(title,url,w,h);
    }
    /*用户-查看*/
    function member_show(title,url,id,w,h){
        layer_show(title,url,w,h);
    }
    /*用户-编辑*/
    function member_edit(title,url,id,w,h){
        layer_show(title,url,w,h);
    }
    /*密码-修改*/
    function change_password(title,url,id,w,h){
        layer_show(title,url,w,h);
    }
    /*用户-删除*/
    function member_del(obj,id){
        layer.confirm('确认要删除吗？',function(index){
            $.ajax({
                type: 'POST',
                url: 'uc?op=delUserByUserId',
                dataType: 'text',
                data:{
                    userId:id
                },
                success: function(info){
                    console.log(info)
                    if (info!='0'){
                        layer.msg("删除成功",{
                            icon:1,
                            time:2000
                        }, function () {
                            //等到当前实例
                            var index = parent.layer.getFrameIndex(window.name);
                            //如何刷新父窗口，将新增的数据实时展示
                            window.location.reload();
                            //关闭当前页面的实例
                            parent.layer.close(index);
                        })
                    }else {
                        layer.msg("删除失败",{
                            icon:2,
                            time:2000
                        }, function () {
                            //等到当前实例
                            var index = parent.layer.getFrameIndex(window.name);
                            //如何刷新当前窗口，将新增的数据实时展示
                            window.location.reload();
                            //关闭当前页面的实例
                            parent.layer.close(index);
                        })
                    }
                },
                error:function(data) {
                    layer.msg("ajax error",{icon:2})
                },
            });
        });
    }
</script>
</body>
</html>

